package com.imporven.sell.util;

import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;

/**
 * @author imporven
 * @version 1.0.0
 * @date 2018-7-8 0:08
 * @description
 */
public class JsonUtil {

    private static final ObjectMapper mapper =  new ObjectMapper();

    public static JavaType getCollectionType(Class<?> collectionClass, Class<?> ... elementClasses){
        return mapper.getTypeFactory().constructParametricType(collectionClass,elementClasses);
    }

    public static ObjectMapper getMapper(){
        return mapper;
    }

}
